package com.example.demo1;

public class TestProtype {

    public static void main(String[] args) throws CloneNotSupportedException {

        ConcretePrototype concretePrototype = new ConcretePrototype();
        Student student = new Student();
        student.setName("张三");
        concretePrototype.setStudent(student);
        ConcretePrototype clone = concretePrototype.clone();

        System.out.println("clone = " + (clone.getStudent() == concretePrototype.getStudent()));

    }

}
